package com.sangsang.kafka.domain.dto;


import java.util.Objects;

/**
 * @author liutangqi
 * @date 2024/3/12 15:04
 */
public class CDCDto {
    /**
     * 实体类的类名
     */
    private String entityName;

    /**
     * 实体类的全限定名
     */
    private String referenceEntityName;

    public static CDCDto.CDCDtoBuilder builder() {
        return new CDCDto.CDCDtoBuilder();
    }

    public String getEntityName() {
        return this.entityName;
    }

    public String getReferenceEntityName() {
        return this.referenceEntityName;
    }

    public void setEntityName(String entityName) {
        this.entityName = entityName;
    }

    public void setReferenceEntityName(String referenceEntityName) {
        this.referenceEntityName = referenceEntityName;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof CDCDto)) {
            return false;
        } else {
            CDCDto other = (CDCDto) o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$entityName = this.getEntityName();
                Object other$entityName = other.getEntityName();
                if (this$entityName == null) {
                    if (other$entityName != null) {
                        return false;
                    }
                } else if (!this$entityName.equals(other$entityName)) {
                    return false;
                }

                Object this$referenceEntityName = this.getReferenceEntityName();
                Object other$referenceEntityName = other.getReferenceEntityName();
                if (this$referenceEntityName == null) {
                    if (other$referenceEntityName != null) {
                        return false;
                    }
                } else if (!this$referenceEntityName.equals(other$referenceEntityName)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof CDCDto;
    }

    @Override
    public int hashCode() {
        return Objects.hash(entityName, referenceEntityName);
    }

    @Override
    public String toString() {
        return "CDCDto(entityName=" + this.getEntityName() + ", referenceEntityName=" + this.getReferenceEntityName() + ")";
    }

    public CDCDto(String entityName, String referenceEntityName) {
        this.entityName = entityName;
        this.referenceEntityName = referenceEntityName;
    }

    public CDCDto() {
    }

    public static class CDCDtoBuilder {
        private String entityName;
        private String referenceEntityName;

        CDCDtoBuilder() {
        }

        public CDCDto.CDCDtoBuilder entityName(String entityName) {
            this.entityName = entityName;
            return this;
        }

        public CDCDto.CDCDtoBuilder referenceEntityName(String referenceEntityName) {
            this.referenceEntityName = referenceEntityName;
            return this;
        }

        public CDCDto build() {
            return new CDCDto(this.entityName, this.referenceEntityName);
        }

        @Override
        public String toString() {
            return "CDCDto.CDCDtoBuilder(entityName=" + this.entityName + ", referenceEntityName=" + this.referenceEntityName + ")";
        }
    }
}